<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;


class CreatePriceLogTable extends Migration
{

    public function up()
    {
        Schema::create('price_log', function (Blueprint $table) {
            $table->unsignedInteger('id')->autoIncrement()->comment('id');
            $table->decimal('fund_balance', 13, 2)->unsigned()->default('0.00')->comment('奖池统计');
            $table->decimal('hscoin_balance', 13, 2)->unsigned()->default('0.00')->comment('金豆统计');
            $table->decimal('price', 9, 2)->unsigned()->default('0.00')->comment('价格');
            $table->tinyInteger('status')->unsigned()->default(0)->comment('0 = 带确定 1 = 有效 -1 = 无效，初始有效，要更改为无效，用新记录做对冲');
            $table->unsignedBigInteger('add_time')->default(0);
            $table->tinyInteger('change_type')->unsigned()->default(0);
            $table->unsignedBigInteger('xid')->default(0);
            $table->index('add_time');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('price_log');
    }
}
